#include <stdio.h>

int duplicate(int* numbers, int numbersLen )
{
    // write code here
    int *times=(int*)calloc(numbersLen, sizeof(int));
    int i=0;
    for(i=0; i<numbersLen; i++)
    {
        times[*(numbers+i)]++;
    }
    for(i=0; i<numbersLen;i++)
    {
        if(times[*(numbers+i)]>1)
        return *(numbers+i);
    }
    return -1;
}
int main()
{
    int arr[]={2,3,1,0,2,5,3};
    int numbersLen = sizeof(arr)/sizeof(arr[0]);
    int s=duplicate(arr,numbersLen);
    printf("%d\n",s);

    return 0;
}
